package personnel.department.pages;

import java.util.List;

import com.google.common.collect.Lists;

import personnel.department.dao.HibernateUtils;
import personnel.department.dao.entity.UniqueObject;
import personnel.department.utils.ReflectionUtils;

public class ModelProvider<T extends UniqueObject> {

	private List<T> uniqueObjects;
	private Class<UniqueObject> clazz;

	public ModelProvider() {
		uniqueObjects = Lists.newArrayList();
		clazz = ReflectionUtils.getGenericParameterClass(getClass(), ModelProvider.class, 0);
		List<T> objects = (List<T>) HibernateUtils.getDAO().getAllObjects(clazz);
//		uniqueObjects.addAll(objects);
	}

	public List<T> getObjects() {
		return uniqueObjects;
	}

} 
